load("//tools/bzl:plugin.bzl", "gerrit_plugin")
#load("@rules_java//java:defs.bzl", "java_binary", "java_library", "java_test")

package(default_visibility = ["//visibility:public"])

gerrit_plugin(
    name = "example-servlet",
    srcs = glob(["src/main/java/**/*.java"]),
    manifest_entries = [
        "Gerrit-PluginName: example-servlet",
        "Gerrit-HttpModule: com.googlesource.gerrit.plugins.examples.servlet.HttpModule",
        "Implementation-Title: Example Servlet",
    ],
    resources = glob(["src/main/resources/**/*"]),
    deps = ["@maven//:junit_junit",
            "@maven//:com_alibaba_fastjson",
            "@maven//:org_apache_poi_poi",
            "@maven//:org_apache_poi_poi_ooxml",
            "@maven//:org_apache_poi_poi_ooxml_schemas",
            "@maven//:com_urswolfer_gerrit_client_rest_gerrit_rest_java_client",
    ],
)

#java_library(
#    name = "hyphenation-service",
#    srcs = glob(["src/main/java/**/*.java"]),
#    deps = [
#         "@maven//:com_alibaba_fastjson",
#         "@maven//:org_apache_poi_poi",
#         "@maven//:org_apache_poi_poi_ooxml",
#         "@maven//:org_apache_poi_poi_ooxml_schemas",
#     ],
#)

#java_test(
#    name = "tests",
#    srcs = glob(["src/main/java/**/*.java"]),
#    test_class = "com.example.myproject.TestApp",
#    deps = [
#        ":java-maven-lib",
#        "@maven//:com_google_guava_guava",
#        "@maven//:junit_junit",
#    ],
#)
#java_library(
#    name = "java-maven-lib",
#    srcs = glob(["src/main/java/**/*.java"]),
#    deps = ["@maven//:com_google_guava_guava"],
#)
#
#java_binary(
#    name = "java-maven",
#    main_class = "com.googlesource.gerrit.plugins.examples.servlet.Tests",
#    runtime_deps = [":java-maven-lib"],
#)
#
#java_test(
#    name = "tests",
#    srcs = glob(["src/main/java/**/*.java"]),
#    test_class = "com.googlesource.gerrit.plugins.examples.servlet.Tests",
#    deps = [
#        ":java-maven-lib",
#        "@maven//:com_google_guava_guava",
#        "@maven//:junit_junit",
#    ],
#)
